<html>
<head><meta charset="utf-8"><title>Miri is awesome! · t-lang/wg-unsafe-code-guidelines · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/index.html">t-lang/wg-unsafe-code-guidelines</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri.20is.20awesome!.html">Miri is awesome!</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="196756574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri%20is%20awesome%21/near/196756574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Elichai Turkel <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri.20is.20awesome!.html#196756574">(May 07 2020 at 11:20)</a>:</h4>
<p>Just wanted to say that every time I see a crate with suspiciously looking unsafe code (unint/pointer offseting) I immediately reach Miri before I start to manually analyze it and it almost always finds the UBs for me :)<br>
So thank you for this tool! <span class="user-mention" data-user-id="120791">@RalfJ</span> <span class="user-mention" data-user-id="124288">@oli</span> and the rest of the contributors!  <br>
(latest: <a href="https://github.com/RustSec/advisory-db/pull/290" title="https://github.com/RustSec/advisory-db/pull/290">https://github.com/RustSec/advisory-db/pull/290</a>)</p>



<a name="196867340"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri%20is%20awesome%21/near/196867340" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri.20is.20awesome!.html#196867340">(May 08 2020 at 07:57)</a>:</h4>
<p><span class="user-mention" data-user-id="249222">@Elichai Turkel</span> so glad that it helps you :)</p>



<a name="196867382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri%20is%20awesome%21/near/196867382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri.20is.20awesome!.html#196867382">(May 08 2020 at 07:57)</a>:</h4>
<p>The one thing I want to warn against is using Miri instead of a manual audit. Miri being green is a great sign but for various reasons does not replace actually understanding the code and convincing yourself that it is correct.</p>



<a name="196867457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri%20is%20awesome%21/near/196867457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri.20is.20awesome!.html#196867457">(May 08 2020 at 07:58)</a>:</h4>
<p>Also, for cases where it did not find the UB but you found it later -- if you think that's a bug in Miri (and not just, say, incomplete coverage of the test suite), please let us know :D</p>



<a name="196874364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri%20is%20awesome%21/near/196874364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Elichai Turkel <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri.20is.20awesome!.html#196874364">(May 08 2020 at 09:30)</a>:</h4>
<p>Obviously not instead, no static analysis will ever cover real logic errors :)</p>
<p>And I think these were mostly either missing shims by miri, outside of miri scope, or outside of stacked borrows (validity of value behind a ref etc)</p>



<a name="196934472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri%20is%20awesome%21/near/196934472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri.20is.20awesome!.html#196934472">(May 08 2020 at 18:43)</a>:</h4>
<p>Miri is not a "static analysis" though :)</p>



<a name="196934536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri%20is%20awesome%21/near/196934536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri.20is.20awesome!.html#196934536">(May 08 2020 at 18:44)</a>:</h4>
<p>(it's a dynamic analysis)</p>



<a name="197838133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri%20is%20awesome%21/near/197838133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/136281-t-lang/wg-unsafe-code-guidelines/topic/Miri.20is.20awesome!.html#197838133">(May 17 2020 at 08:45)</a>:</h4>
<p>While I have the attention of some Miri users, could I ask you for feedback on <a href="https://github.com/rust-lang/miri/issues/1416">this issue</a> concerning a potential breaking change in <code>cargo miri test</code> argument handling? Cc <span class="user-mention" data-user-id="249222">@Elichai Turkel</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>